 
package com.mixide.ui.part;

import javax.annotation.PostConstruct;
import javax.inject.Inject;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;

import com.mixide.ui.service.MixHolder;

import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor(onConstructor_=@Inject)
public class ConsolePart {
	
	private final MixHolder mix;
	
	@PostConstruct
	public void postConstruct(Composite parent) {
		parent.setLayout(new FillLayout());
		StyledText text = new StyledText(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
		text.setText(new String(this.mix.out().toByteArray()));
	}
}